@Echo off

set MSBuild="%WINDIR%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"

cd /d %~dp0
%MSBuild% .\Launch\Launch.vbproj /t:Rebuild /p:Configuration=Release /p:Platform="anycpu"
%MSBuild% .\UpdateDLL\UpdateDLL.vbproj /t:Rebuild /p:Configuration=Release /p:Platform="anycpu"
%MSBuild% .\SDRun.vbproj /t:Rebuild /p:Configuration=Release /p:Platform="x86"
%MSBuild% .\SDRun.vbproj /t:Rebuild /p:Configuration=Release /p:Platform="x64"

del /s /q .\bin\publish\SDRun\*.*
mkdir .\bin
mkdir .\bin\publish
mkdir .\bin\publish\SDRun

copy .\bin\x64\Release\Newtonsoft.Json.dll .\bin\publish\SDRun\
copy .\bin\x64\Release\SDRun.exe .\bin\publish\SDRun\SDRun_x64.exe
copy .\bin\x64\Release\ToolGood.Words.Pinyin.dll .\bin\publish\SDRun\
copy .\UpdateDLL\bin\Release\UpdateDLL.dll .\bin\publish\SDRun\
copy .\bin\x86\Release\SDRun.exe .\bin\publish\SDRun\SDRun_x86.exe
copy .\Launch\bin\Release\Launch.exe .\bin\publish\SDRun\
copy .\README.md .\bin\publish\SDRun\

pause
